<?php
// R0910CMS 
// created by TLightSky
// time : 20100120

if(!defined("IN_R0910CMS")) {
    exit("Access Denied!");
}

class Admin_DbModel_Right extends R_Db_Row {
	function init(){
		$this->tableName   = getInstance('Admin_Manage')->getConfig('sitepre')."right";
        $this->col['id'] = &R_Db_CellFactory::get(R_Db_DataCheck::INTEGER,10);
        $this->col["id"]   ->setPrimary()
                           ->setNotNull()
                           //->setDefaultValue(0)
                           ->setUnsigned()
                           ->setAutoIncrement();
		$this->col["name"]  = &R_Db_CellFactory::get(R_Db_DataCheck::STRING,50);
		$this->col["name"] ->setNotNull()
						   ->setComment("Name of the right");
		$this->col["action"]  = &R_Db_CellFactory::get(R_Db_DataCheck::STRING,50);
		$this->col["action"] ->setNotNull()
						   ->setComment("ActionClass/method");
        $this->col['menuid'] = &R_Db_CellFactory::get(R_Db_DataCheck::INTEGER,10);
        $this->col["menuid"] ->setNotNull()
                             ->setUnsigned()
                             ->setComment("id in menu table");
		$this->col["actionhash"]  = &R_Db_CellFactory::get(R_Db_DataCheck::STRING,32);
		$this->col["actionhash"] ->setNotNull()
						   ->setComment("Hash code of the action");
						   
        $this->col['show'] = &R_Db_CellFactory::get(R_Db_DataCheck::INTEGER,1);
        $this->col['show'] ->setNotNull();
        $this->col["show"] ->setNotNull()
        				   ->setComment("can be see from broswer");
        
	}
}
